package com.edu.object1;

public class Car {
    //数据的封装，对应test03
    private String name;
    private double price;

    public Car() {//默认存在的，但假如加入了有参构造就必须再加上无参构造
    }

    public Car(String name, double price) {//可写可不写的，但假如写了，就必须再加上无参构造
        this.name = name;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
